﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CrmCustomInstallActions.UI
{
    public partial class CrmSolutionInstallerAskForm : Form
    {
        public enum ChoiceResult
        {
            Choice1 = 1,
            Choice2 = 2
        }

        private ChoiceResult SelectedChoice;
        public CrmSolutionInstallerAskForm()
        {
            InitializeComponent();
        }

        public ChoiceResult ShowDialog(string Question, string Choice1, string Choice2)
        {

            this.Question.Text = Question;
            this.Choice1.Text = Choice1;
            this.Choice2.Text = Choice2;
            this.ShowDialog();
            return SelectedChoice;

        }


        private void Choice1_MouseHover(object sender, EventArgs e)
        {
            Choice1.Font = new Font(Choice1.Font, FontStyle.Bold);
            Choice1.BorderStyle = BorderStyle.FixedSingle;
            Choice1.Cursor = Cursors.Hand;

        }

        private void Choice2_MouseHover(object sender, EventArgs e)
        {
            Choice2.Font = new Font(Choice2.Font, FontStyle.Bold);
            Choice2.BorderStyle = BorderStyle.FixedSingle;
            Choice2.Cursor = Cursors.Hand;
        }

        
        private void Choice1_MouseLeave(object sender, EventArgs e)
        {
            Choice1.Font = new Font(Choice1.Font, FontStyle.Regular);
            Choice1.BorderStyle = BorderStyle.None;
            Choice1.Cursor = Cursors.Default;
        }

        private void Choice2_MouseLeave(object sender, EventArgs e)
        {
            Choice2.Font = new Font(Choice2.Font, FontStyle.Regular);
            Choice2.BorderStyle = BorderStyle.None;
            Choice2.Cursor = Cursors.Default;
        }

        private void Choice1_Click(object sender, EventArgs e)
        {
            SelectedChoice = ChoiceResult.Choice1;
            this.Hide();
        }

        private void Choice2_Click(object sender, EventArgs e)
        {
            SelectedChoice = ChoiceResult.Choice2;
            this.Hide();
        }
    }
}
